Ext.define('config.view.SettingFolderForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.SettingFolderForm',
    margins:'5 5 5 5 ',
    bodyPadding: 10,
    title: '环境配置',
	
    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
			url: 'save-form.php',
            items: [
                {
                    xtype: 'textfield',
                    fieldLabel: '参数环境目录',
					name:'configpath',
                    anchor: '100%'
                }
            ],
            dockedItems: [
                {
                    xtype: 'toolbar',
                    ui: 'footer',
                    dock: 'bottom',
                    layout: {
                        pack: 'center',
                        type: 'hbox'
                    },
                    items: [
                        {
                            xtype: 'button',
                            minWidth: 80,
                            text: '确 认',
							handler: function(){
								var form = this.up('form').getForm();
								if (form.isValid()) {
									// submit form ---
									form.submit({
										success: function(form, action){
											Ext.Msg.alert('Success', action.result.msg);
										},
										failure: function(form, action){
											Ext.Msg.alert('Failed', action.result.msg);
										}
										
									});
								}
							}
                        },
                        {
                            xtype: 'button',
                            minWidth: 80,
                            text: '取 消'
                        }
                    ]
                }
            ]				
        });

        me.callParent(arguments);
    }
});